﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Windows.Resources;
using System.ComponentModel;
using VIBlend.WPF.Controls;
using System.Reflection;
using System.Data;
using AnonsaiWPF.NwindDataSetTableAdapters;

namespace AnonsaiWPF.CSharp.DataGridViewDemos
{
    [Category("VIBlend.WPF.Examples")]
    public partial class DataListDemo : Window, IWindow
    {
        #region IWindow Members

        public void DetachContent()
        {
            RemoveLogicalChild(Content);
        }

        public Grid Root
        {
            get
            {
                return this.LayoutRoot;
            }
        }
        #endregion

        public DataListDemo()
        {
            InitializeComponent();
      
            this.dataGrid1.ItemsSource = firstNames;
            this.dataGrid1.ColumnsHierarchy.Items[0].CellStyle = Application.Current.Resources["TextCenteredCellStyle"] as Style;
            this.dataGrid1.ColumnsHierarchy.Items[0].Width = 200;         
            this.dataGrid1.RowsHierarchy.SetColumnWidth(0, 25);
            this.dataGrid1.Refresh();
        }

        string[] firstNames = new string[] 
                {
                    "Andrew",
                    "Nancy",
                    "Shelley",
                    "Regina",
                    "Yoshi",
                    "Antoni",
                    "Mayumi",
                    "Ian",
                    "Peter",
                    "Lars",
                    "Petra",
                    "Martin",
                    "Sven",
                    "Elio",
                    "Beate",
                    "Cheryl",
                    "Michael",
                    "Guylène"
                };
    
        public void SetTheme()
        {
            dataGrid1.FontFamily = new FontFamily("Tahoma");
        }
    } 


}
